function getAllClassGender(id, classNameY, nanX1, nvX2) {
  var chartDom = document.getElementById(id);
  var myChart = echarts.init(chartDom);
  var option = {
    title: {
      text: '班级性别信息分析',
      textStyle: {
        //文字颜色
        color: '#ccc',
        //字体风格,'normal','italic','oblique'
        fontStyle: 'normal',
        //字体粗细 'normal','bold','bolder','lighter',100 | 200 | 300 | 400...
        fontWeight: 'bold',
        //字体系列
        fontFamily: 'sans-serif',
        //字体大小
        fontSize: 18
      }
    },
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'shadow'
      }
    },
    legend: {
      data: ['男', '女'],
      left: 'right',
      textStyle: {
        color: '#ffffff'
      }
    },
    grid: {
      left: '3%',
      right: '4%',
      bottom: '3%',
      containLabel: true
    },
    xAxis: {
      type: 'category',
      data: classNameY,
      axisLabel: {
        show: true,
        textStyle: {
          color: '#ffffff'
        }
      }
    },
    yAxis: {

      type: 'value',
      boundaryGap: [0, 0.01],
      axisLabel: {
        show: true,
        textStyle: {
          color: '#ffffff'
        }
      }
    },
    series: [
      {
        name: '男',
        type: 'line',
        data: nanX1,
        itemStyle: {
          color: '#FFCC99',

        }
      },
      {
        name: '女',
        type: 'line',
        data: nvX2,
        itemStyle: {
          color: '#FF9966',
        }
      }
    ]
  };
  myChart.setOption(option);
  window.addEventListener("resize",function(){
    myChart.resize();
  });
}


function getGenderConunt(id, data) {
  var chartDom = document.getElementById(id);
  var myChart = echarts.init(chartDom);
  option = {
    title: {
      text: '性别信息分析',
      subtext: '总人数：' + data.sumCount,
      textStyle: {
        color: '#ffffff'
      },
      left: 'center'
    },
    tooltip: {
      trigger: 'item',
      formatter: '{a} <br/>{b} : {c} ({d}%)'
    },
    legend: {
      orient: 'vertical',
      left: 'right',
      data: ['男', '女'],
      textStyle: {
        color: '#ffffff'
      }
    },
    series: [
      {
        name: '男女人数',
        type: 'pie',
        radius: '55%',
        center: ['50%', '60%'],
        data: [
          { value: data.maleCount, name: '男' },
          { value: data.femaleCount, name: '女' },
        ],
        emphasis: {
          itemStyle: {
            shadowBlur: 10,
            shadowOffsetX: 0,
            shadowColor: 'rgba(0, 0, 0, 0.5)'
          }
        },itemStyle: {
          color: function (params) {
            //自定义颜色
            var colorList = ['#FFFFCC', '#669966'];
            return colorList[params.dataIndex];
          }
        }
      }
    ]
  };

  myChart.setOption(option);
  window.addEventListener("resize",function(){
    myChart.resize();
  });
}


function getSemesterGender(id, classNameY, nanX1, nvX2) {
  var chartDom = document.getElementById(id);
  var myChart = echarts.init(chartDom);
  var option = {
    title: {
      text: '学期性别信息分析',
      textStyle: {
        //文字颜色
        color: '#ccc',
        //字体风格,'normal','italic','oblique'
        fontStyle: 'normal',
        //字体粗细 'normal','bold','bolder','lighter',100 | 200 | 300 | 400...
        fontWeight: 'bold',
        //字体系列
        fontFamily: 'sans-serif',
        //字体大小
        fontSize: 18
      }
    },
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'shadow'
      }
    },
    legend: {
      data: ['男', '女'],
      left: 'right',
      textStyle: {
        color: '#ffffff'
      }
    },
    grid: {
      left: '3%',
      right: '4%',
      bottom: '3%',
      containLabel: true
    },
    xAxis: {
      type: 'value',
      boundaryGap: [0, 0.01],
      axisLabel: {
        show: true,
        textStyle: {
          color: '#ffffff'
        }
      }
    },
    yAxis: {
      type: 'category',
      data: classNameY,
      axisLabel: {
        show: true,
        textStyle: {
          color: '#ffffff'
        }
      }
    },
    series: [
      {
        name: '男',
        type: 'bar',
        data: nanX1,
        itemStyle: {
          color: '#006699',
        }
      },
      {
        name: '女',
        type: 'bar',
        data: nvX2,
        itemStyle: {
          color: '#FF9999',
        }
      }
    ]
  };
  myChart.setOption(option);
  window.addEventListener("resize",function(){
    myChart.resize();
  });
}



function getStatusGender(id, data) {
  var chartDom = document.getElementById(id);
  var myChart = echarts.init(chartDom);
  var option = {
    title: {
      text: '出勤性别分析',
      textStyle: {
        //文字颜色
        color: '#ccc',
        //字体风格,'normal','italic','oblique'
        fontStyle: 'normal',
        //字体粗细 'normal','bold','bolder','lighter',100 | 200 | 300 | 400...
        fontWeight: 'bold',
        //字体系列
        fontFamily: 'sans-serif',
        //字体大小
        fontSize: 18
      }
    },
    legend: {
      left: 'right',
      textStyle: {
        color: '#ffffff'
      }
    },
    tooltip: {},
    dataset: {
      source: data
    },
    xAxis: {
      type: 'category',
      axisLabel: {
        show: true,
        textStyle: {
          color: '#ffffff'
        }
      }
    },
    yAxis: {
      axisLabel: {
        show: true,
        textStyle: {
          color: '#ffffff'
        }
      }
    },
    // Declare several bar series, each will be mapped
    // to a column of dataset.source by default.
    series: [
      { type: 'bar',
        itemStyle: {
          color: '#99CC00',
        }
      },
      { type: 'bar' ,
        itemStyle: {
          color: '#9999CC',
        }
      },

    ]
  };
  myChart.setOption(option);
  window.addEventListener("resize",function(){
    myChart.resize();
  });
}



function getSemesterClassGender(id, classNameY, nanX1, nvX2) {
  var chartDom = document.getElementById(id);
  var myChart = echarts.init(chartDom);
  var option = {
    title: {
      text: '班级性别信息分析',
      textStyle: {
        //文字颜色
        color: '#ccc',
        //字体风格,'normal','italic','oblique'
        fontStyle: 'normal',
        //字体粗细 'normal','bold','bolder','lighter',100 | 200 | 300 | 400...
        fontWeight: 'bold',
        //字体系列
        fontFamily: 'sans-serif',
        //字体大小
        fontSize: 18
      }
    },
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'shadow'
      }
    },
    legend: {
      data: ['男', '女'],
      left: 'right',
      textStyle: {
        color: '#ffffff'
      }
    },
    grid: {
      left: '3%',
      right: '4%',
      bottom: '3%',
      containLabel: true
    },
    xAxis: {
      type: 'value',
      boundaryGap: [0, 0.01],
      axisLabel: {
        show: true,
        textStyle: {
          color: '#ffffff'
        }
      }
    },
    yAxis: {
      type: 'category',
      data: classNameY,
      axisLabel: {
        show: true,
        textStyle: {
          color: '#ffffff'
        }
      }
    },
    series: [
      {
        name: '男',
        type: 'bar',
        data: nanX1,
        itemStyle: {
          color: '#99CCFF',
        }
      },
      {
        name: '女',
        type: 'bar',
        data: nvX2,
        itemStyle: {
          color: '#CC6666',
        }
      }
    ]
  };
  myChart.setOption(option);
  window.addEventListener("resize",function(){
    myChart.resize();
  });
}


